<template>
    <div class="child1">
    <h2>子组件</h2>
    <h4>玩具:{{ toy }}</h4>
    <button @click="emit('haha',666)">测试</button>
    </div>
</template>
<script setup lang="ts"> 
import { ref } from 'vue';
let toy = ref("小小标题")
const emit = defineEmits(['haha'])
</script>
<style scoped>
.child {
    padding: 20px;
    background-color: rgb(51, 138, 93);
    border: 1px solid #ccc;
    border-radius: 4px;
}
</style>